<template>
  <a-modal
    :title="`费用${model?'编辑':'新增'}`"
    :width="640"
    :visible="visible"
    :confirmLoading="loading"
    @ok="handleOk"
    @cancel="handleCancel"
  >
    <a-spin :spinning="loading">
      <a-form :form="form" v-bind="formLayout">
        <a-form-item v-show="false" label="主键ID">
          <a-input v-decorator="['id']" disabled />
        </a-form-item>
        <a-form-item label="名称">
          <a-input v-decorator="['name']" placeholder="填写名称"/>
        </a-form-item>
        <a-form-item label="参数">
          <a-input-number v-decorator="['value']" placeholder="填写参数"/>
        </a-form-item>
      </a-form>
    </a-spin>
  </a-modal>
</template>

<script>
import formModalMixin from '@/mixins/formModalMixin'
import { priceEdit } from '@/api/price'
// 表单字段
const fields = [ 'id', 'value', 'name' ]

export default {
  mixins: [formModalMixin],
  data () {
    this.fields = fields
    this.editAction = priceEdit
    return {

    }
  }
}
</script>
